<?php

require_once dirname(__FILE__).'/../lib/vendor/symfony/lib/autoload/sfCoreAutoload.class.php';
sfCoreAutoload::register();

class ProjectConfiguration extends sfProjectConfiguration
{
  public function setup()
  {
    $this->enablePlugins('sfPropelPlugin');

    $this->enablePlugins('sfJqueryReloadedPlugin');
    $this->enablePlugins('sfFormExtraPlugin');
  }
  
  public static function loadEnvironment($env = null, $debug = null)
  {
      $filename = dirname(__FILE__).'/environment.yml';
      $handle = fopen($filename, 'r');
      $contents = fread($handle, filesize ($filename));
      fclose($handle);

      $yaml = new sfYamlParser();
      $yaml_parse = $yaml->parse($contents);
      
      $env = $env == null ? $yaml_parse['init']['environment'] : $env;
      $debug = $debug == null ? $yaml_parse['init']['debug'] : $debug;
      
      return self::getApplicationConfiguration("frontend", $env, $debug);
  }
}